import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) throws InterruptedException{
        Object object = new Object();
        Thread t1 = new Thread(()->{
            System.out.println("00");
            synchronized (object){
                try {
                    object.wait();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
            System.out.println("out");
        });
        Thread t2 = new Thread(()->{
            System.out.println("11");
            Scanner scanner = new Scanner(System.in);
            scanner.next();
            synchronized (object){
                object.notify();
            }
        });
        t1.start();
        t2.start();

    }
}
